﻿using System;

namespace MathCompiler.Calculators.Standard
{
    internal sealed class CalculatorLogarithm : IOperationCalculator
    {
        public double Calculate(params double[] parameters)
        {
            if (parameters == null)
                throw new ArgumentNullException("parameters");

            if (parameters.Length != 1)
                throw new ArgumentException("Logarithm function should have 1 parameter.", "parameters");

            return System.Math.Log(parameters[0]);
        }
    }
}